package com.etcn.common.listener;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

import org.springframework.stereotype.Component;

import com.etcn.common.utils.UserUtil;

/**
 * session属性变化监听器
 * 
 * @author guozc
 */
@Component
public class CustomHttpSessionAttributeListener implements HttpSessionAttributeListener {

	@Override
	public void attributeAdded(HttpSessionBindingEvent se) {
		if ("memberId".equals(se.getName())) {    
			UserUtil.set((String)se.getValue());
        }  
	}

	@Override
	public void attributeRemoved(HttpSessionBindingEvent se) {
	}

	@Override
	public void attributeReplaced(HttpSessionBindingEvent se) {
	}


}
